#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	if (n % 2 == 0 && n > 4 && n <= 12) {
		cout << 1;
	}
	else {
		cout << 0;
	}
	cout << " ";
	if (n % 2 == 0 ) {
		cout << 1;
	}
	else {
		cout << 0;
	}
	cout << " ";
	int flag1 = 0;
	int flag2 = 0;
	if (n % 2 == 1) {
		flag1 = 1;
	}
	if (n > 4 && n < 12) {
		flag2 = 1;
	}
	if (flag1 + flag2 == 1) {
		cout << 1;
	}
	else {
		cout << 0;
	}
	cout << " ";
	if (n % 2 == 1 && (n <= 4 && n > 12)) {
		cout << 1 << endl;
	}
	else {
		cout << 0 << endl;
	}
	return 0;
}